package io.geekidea.boot.jieanbo.controller;

import io.geekidea.boot.framework.page.Paging;
import io.geekidea.boot.framework.response.ApiResult;
import io.geekidea.boot.jieanbo.query.AppAiSetQuery;
import io.geekidea.boot.jieanbo.service.AiSetService;
import io.geekidea.boot.jieanbo.vo.AppAiSetVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * AppAI设置表 控制器
 *
 * @author geekidea
 * @since 2025-06-04
 */
@Slf4j
@RestController
@Tag(name = "AppAI设置表")
@RequestMapping("/app/aiSet")
public class AppAiSetController {

    @Autowired
    private AiSetService aiSetService;

    /**
     * 获取AppAI设置表详情
     *
     * @param id
     * @return
     * @throws Exception
     */
    @Operation(summary = "获取AppAI设置表详情")
    @PostMapping("/getAppAiSet/{id}")
    public ApiResult<AppAiSetVo> getAppAiSet(@PathVariable Integer id) {
        log.info("获取AppAI设置表详情：{}", id);
        AppAiSetVo appAiSetVo = aiSetService.getAppAiSetById(id);
        return ApiResult.success(appAiSetVo);
    }

    /**
     * 获取AppAI设置表分页列表
     *
     * query
     * @return
     * @throws Exception
     */
    @Operation(summary = "获取AppAI设置表分页列表")
    @PostMapping("/getAppAiSetPage")
    public ApiResult<AppAiSetVo> getAppAiSetPage(@Valid @RequestBody AppAiSetQuery query) {
        log.info("获取AppAI设置表分页列表：{}", query);
        Paging<AppAiSetVo> paging = aiSetService.getAppAiSetPage(query);
        return ApiResult.success(paging);
    }

}
